<?php

/**
 * @author zhuang<pingguoli@gmail.com>
 * @Date 2020/7/3 上午8:28
 *
 * @copyright Copyright 2020 - 2021
 */


namespace App\Http\Controllers\Wechat;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;

class TokenController extends BaseController
{

    public function checkToken(Request $request){
        Log::info('request arrived.');

        $app = app('wechat.official_account');
        $app->server->push(function($message){
            return "欢迎关注 overtrue！";
        });
        $user = session('wechat.oauth_user.default'); // 拿到授权用户资料
        //dd($user);
        Log::info($user);
        Log::info('return response.');
        return $app->server->serve();


    }
}